#include "interval.h"
#include <iomanip>  

int main() 
{                  
	interval<double> I1(2,1);
	interval<double> U1(5,1);
	interval<double> I2(2,2);
	interval<double> U2(5,2);
	interval<double> I3(2,4);
	interval<double> U3(5,2);

	cout << "Resistansintervall 1 = " << I1/U1 << endl;
	cout << "Effektintervall 1 = " << U1*I1 << endl;
	cout << "Absolut fel 1 = " << I1.absolute_error() << endl;
	cout << "Procentuellt fel 1 = " << I1.procentual_error() << "%" << endl;
	
	cout << endl;
	
	cout << "Resistansintervall 2 = " << I2/U2 << endl;
	cout << "Effektintervall 2 = " << U2*I2 << endl;
	cout << "Absolut fel 2 = " << I2.absolute_error() << endl;
	cout << "Procentuellt fel 2 = " << I2.procentual_error() << "%" << endl;

	cout << endl;

	cout << "Resistansintervall 3 = " << I3/U3 << endl;
	cout << "Effektintervall 3 = " << U3*I3 << endl;
	cout << "Absolut fel 3 = " << I3.absolute_error() << endl;
	cout << "Procentuellt fel 3 = " << I3.procentual_error() << "%" << endl;

	system("pause");     
	return 0; 
} 